<?php 
namespace  app\modules\admin\controllers;
use yii;
use yii\web\Controller;
use yii\midules\Article;
use app\modules\admin\models\LoginForm;
class IndexController extends Controller {
   public $enableCsrfValidation = false;   //开起POST请求
   public function actionLogin() {
      return $this->renderPartial('login');
   }
   public function actionDoLogin(){
      $login  = new LoginForm();
      $res = $login::dologin($_POST['userName'],$_POST['userPwd']);
      
      
      if(!$res){
         $resMes['name'] = '温馨提示';
         $resMes['title'] ='温馨提示';
         $resMes['message'] = '用户名不存在！';
      }
    
      return  $this->renderPartial('/error',$resMes);
   }
      /**
       * 用户登录
       */
   //  public function actionDoLogin(){

   //  }
}

